package com.zbxx.springboot1.service.Impl;
import com.zbxx.springboot1.Dao.UserDao;
import com.zbxx.springboot1.domain.User;
import com.zbxx.springboot1.service.UserService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    @Override
    public User login(String name, String password) {
        User user=userDao.login(name,password);
        return user;
    }

    @Override
    public List<User> SelectUserAll() {
        List<User> list=userDao.SelectUserAll();
        return list;
    }

    @Override
    public int deleteUser(Long id) {
        int num=userDao.deleteUser(id);
        return num;
    }

    @Override
    public User editUserId(Long id) {
        return userDao.editUserId(id);
    }

    @Override
    public int editUser(User user) {
        int num=userDao.editUser(user);
        return num;
    }

    @Override
    public int addUser(User user) {
        int num=userDao.addUser(user);
        return num;
    }

    @Override
    public int reg(User user) {
        int num =userDao.reg(user);
        return num;
    }

    @Override
    public List<User> findinfo(User name) {
        List<User> list2=userDao.findinfo(name);
        return list2;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }
}
